package com.aaa.dao.impl;

import com.aaa.dao.BaseDao;
import com.aaa.dao.PaikeDao;
import com.aaa.entity.PaikemingxiEntity;

import java.util.List;

public class PaikeDaoImpl extends BaseDao implements PaikeDao {
    @Override
    public int add(PaikemingxiEntity info) {
        String sql="insert into paikemingxi (classid,shiduan,keshi,classroom,teacher,dayweek) value(?,?,?,?,?,?)";
        return this.executeInsert(sql,info.getClassId(),info.getShiduan(),info.getKeshi(),info.getClassroom(),info.getTeacher(),info.getDayweek());
    }

    @Override
    public List queryclass() {
        String sql="select classid,classname from class WHERE progressing=0 and del_flag=0";
        return this.executeQuery(sql);
    }

    @Override
    public List queryroom() {
        String sql="select room_name from class_room";
        return this.executeQuery(sql);
    }

    @Override
    public List queryteacher() {
        String sql="select user_name from sys_user a,sys_role b,sys_user_role c WHERE b.role_id=10 AND a.user_id=c.user_id AND c.role_id=b.role_id;";
        return this.executeQuery(sql);
    }

    @Override
    public List query() {
        String sql="SELECT * from class,paikemingxi WHERE class.classid=paikemingxi.classid;";
        return this.executeQuery(sql);
    }
}
